import Vue from 'vue'
import Router from 'vue-router'
import layout from './views/layout/layout.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'layout',
      component: layout,
      meta:{
        'title':'layout'
      },
      redirect:'home',
      children:[
        {
          path: '/home',
          name:'Home',
          component:()=>import('./views/index/index.vue'),
          meta:{
            title:'控制台'
          }
        },{
          path:'/note',
          name:'note',
          component:()=>import('./views/tools/note/index.vue'),
          meta:{
            title:'笔记列表'
          }
        },{
          path:'/bills',
          name:'bills',
          component:()=>import('./views/tools/bills/index.vue'),
          meta:{
            title:'账单管理'
          }
        },{
          path:'/sheets',
          name:'sheets',
          component:()=>import('./views/tools/note/sheets.vue'),
          meta:{
            title:'笔记详情'
          }
        },{
          path:'/article',
          name:'article',
          component:()=>import('./views/tools/article/index.vue'),
          meta:{
            title:'文章列表'
          }
        },{
          path:'/article/create',
          name:'createArticle',
          component:()=>import('./views/tools/article/create.vue'),
          meta:{
            title:'文章列表'
          }
        },{
          path:'/article/edit',
          name:'editArticle',
          component:()=>import('./views/tools/article/edit.vue'),
          meta:{
            title:'文章列表'
          }
        },{
          path:'/video',
          name:'video',
          component:()=>import('./views/tools/video/index.vue'),
          meta:{
            title:'视频'
          }
        },{
          path:'/play',
          name:'play',
          component:()=>import('./views/tools/video/play.vue'),
          meta:{
            title:'视频播放'
          }
        },{
          path:'/config',
          name:'Config',
          component:()=>import('./views/setting/config.vue'),
          meta:{
            title:'设置'
          }
        }
      ]
    },{
      path:'/login',
      name:'login',
      component: () => import('./views/login/login.vue'),
      meta:{
        title:'Login',
        pass: true
      }
    },{
      path:'*',
      name:'404',
      component:() => import('./views/index/404.vue'),
      meta:{
        title:'404',
        pass: true
      }
    }
  ]
})
